class: center, middle, inverse, title-slide # Review R ### Psych 10 C ### University of California, Irvine ### 04/04/2022 --- ## Review of R - In this class we will review some of the basic elements in R. -- - R is a programming language -- - One of its main advantages is that users are able to write code and functions and make them available for other users. -- - These functions come in the form of packages which we can download using RStudio. --- class: inverse, center, middle # Scripts and R Markdown --- ## R scripts - R scripts are use to write and store code, for example, if we want to analyze the data of an experiment, we can write a script that does multiple operations and stores new data with what we want to show. -- - We use them to make sure that we can replicate a data analysis, or to save the code we used to generate a plot. --- ## R Markdown - R Markdown files `.rmd` are different from simple R scripts. -- - It allows us to integrate text and R code in a single file. -- - Whenever we "knit" this type of file, the integrated R code is executed and the variables are saved momentarily. -- - Notice that the variables are not saved in R as when "running" an R script, but they are saved in memory while the file is being created, which means that we can use them inside the document. -- - This is really useful when we have graphs or outcomes of a data analysis that we want to integrate into a report. --- class: inverse, center, middle # RSudio --- ## RStudio - RStudio is a graphical interface for R. It makes it easier to interact with R by maintaining the console, scripts and graphs all in the same place. -- - From this point on, we will work simultaneously with RStudio and the lecture notes as you should do when working on your assignments. -- Let's say that we have been assigned a data file to work with on a homework, and that we are given a URL to the file such as: ```r link <- "https://raw.githubusercontent.com/ManuelVU/psych-10c-data/main/stroop.csv" ```